<?php
/**
 * [PHPFOX_HEADER]
 */

defined('PHPFOX') or exit('NO DICE!');

/**
 *
 *
 * @copyright		[PHPFOX_COPYRIGHT]
 * @author  		Raymond Benc
 * @package  		Module_Feed
 * @version 		$Id: display.class.php 4621 2012-09-12 05:34:34Z Raymond_Benc $
 */
class Survey_Component_Block_Your_Following extends Phpfox_Component
{
	/**
	 * Class process method wnich is used to execute this component.
	 */
	public function process()
	{
		$iPage = $this->request()->get("page",1);
                $oService = Phpfox::getService("survey.browse");
                if (defined('PHPFOX_IS_USER_PROFILE'))
                {
                        $aUser = $this->getParam('aUser');
                        $iUserId = $aUser["user_id"];
                }
                else{
                    $iUserId = Phpfox::getUserId();
                }
                $oService->follower($iUserId);
                $oService->setCondition("AND sf.user_id IS NOT NULL");
		list($iCount, $aSurveys) = $oService->get($iPage, 5);
		Phpfox::getLib('pager')->set(array('page' => $iPage, 'size' => 5, 'count' => $iCount, 'ajax' => 'survey.viewMoreYourFollowing'));
		$this->template()->assign(array(
				'sHeader' => "Following",
				'iCnt' => $iCount,
				'aItems' => $aSurveys,
                                'bShowFollow' => true,
                                'bShowFollowing' => false,
                                "bHideUserInfo"=> true
			)
		);
		return 'block';
	}
}

?>